<pre class="docs-method-signature"><code>graph.toJSON()</code></pre>

<p>Return an object representation of the graph, which can be used for persistence or serialization. Use the <code>graph.fromJSON()</code> <a href="#dia.Graph.prototype.fromJSON">function</a> to load a previously converted graph.</p>

<p>Note that this method does not return a JSON string but rather an object that can then be serialized to JSON with <code>JSON.stringify(jsonObject)</code>:</p>

<pre><code>var jsonString = JSON.stringify(graph.toJSON());</code></pre>
